import Vue from 'vue'
import Router from 'vue-router'
import Chats from '@/pages/Main/Chats/Chats.vue'
import Contacts from '@/pages/Main/Contacts/Contacts.vue'
import Discover from '@/pages/Main/Discover/Discover.vue'
import Main from '@/pages/Main/Main.vue'
import Login from '@/pages/Login/Login.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/main',
      component: Main,
      children: [
        {
          path: '',
          redirect: 'chats'
        },
        {
          path: 'chats',
          component: Chats
        },
        {
          path: 'contacts',
          component: Contacts
        },
        {
          path: 'discover',
          component: Discover
        }
      ]
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/',
      redirect: '/main'
    }
  ]
})
